﻿#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;

int main() {
	srand(time(NULL));
	int no = rand() % 100;
	int x;

	cout << "猜数字游戏开始\n";
	cout << "请猜一个0-99的数字。\n";

	do {
		cout << "你猜的数字：";
		cin >> x;

		if (x > no) {
			cout << "大了\n";
		}
		else if (x < no) {
			cout << "小了\n";
		}
	} while (x != no);

	cout << "恭喜你猜对了\n";

	cin.get();
	cin.get();
}